import Vue from "vue";
import VueRouter from "vue-router";
import BaseLayout from "../layouts/BaseLayout.vue";
import Login from "../views/Login.vue";
import Home from "../views/Home.vue";
import Add from "../views/Add.vue";
import Mine from "../views/Mine.vue";

Vue.use(VueRouter);

const routes = [
    {
        path: "/login",
        component: Login,
    },
    {
        path: "/main",
        component: BaseLayout,
        children: [
            {
                path: "/main/home",
                component: Home,
            },
            {
                path: "/main/add",
                component: Add,
            },
            {
                path: "/main/mine",
                component: Mine,
            },
        ],
    },
];

const router = new VueRouter({
    mode: "history",
    base: process.env.BASE_URL,
    routes,
});

export default router;
